<template>
  <vue-office-docx :src="docx" style="height: 100vh" />
</template>
<script lang="ts" setup>
//引入VueOfficeDocx组件
import VueOfficeDocx from "@vue-office/docx";
//引入相关样式
import "@vue-office/docx/lib/index.css";
import { useRoute } from "vue-router";
import { downloadFile } from "../../api/modules/file";
const route = useRoute();
const url = route.query.url;

const docx = ref<any>("");
function getUrl() {
  if (!url) return;
  downloadFile(url as string).then((res) => {
    docx.value = res;
  });
}

getUrl();
</script>
<style scoped lang="scss"></style>
